package com.shujia.wyh.day06.homework.test5;

public class Cylinder extends Circle {
    private double hight;

    public Cylinder(double hight) {
        this.hight = hight;
    }

    public Cylinder(double radius, double hight) {
        super(radius);
        this.hight = hight;
    }

    public double getHight() {
        return hight;
    }

    public void setHight(double hight) {
        this.hight = hight;
    }

    //    double getVolume（）	//获取圆柱体的体积
    //    void showVolume（）	//将圆柱体的体积输出到屏幕
    public double getVolume() {
        return getArea() * hight;
    }

    public void showVolume() {
        System.out.println("圆柱体的体积为：" + getVolume());
    }

}
